<?php
/**
 * @auther:周卫星
 * @date:2019/11/1
 * @fileName:region_list.blade.php
 * @fileDesc: 餐台区域列表
 */
?>

@extends('biz.layout.biz_layout')
@section('title', '餐台管理-餐台区域')
@push('css')
@endpush

@push('js')
    <script src="{{ Illuminate\Support\Facades\URL::asset('js/biz/table/region.js') }}"></script>
@endpush

@section('content')
    <div class="layui-btn-container">
        <button class="layui-btn" id="addBtn">添加餐台区域</button>
    </div>
    <table id="regionList" lay-filter="regionList">
        <script id="set" type="text/html">
            <div class="layui-btn-container">
                <button type="button" data-id="@{{ d.id }}" lay-event="edit" class="layui-btn">编辑</button>
                <button type="button" data-id="@{{ d.id }}" lay-event="del" class="layui-btn">删除</button>
            </div>
        </script>
    </table>
    {{-- 获取餐台区域的详细信息以及修改餐台区域的信息 --}}
    <div id="editRegion" class="layui-fluid" style="display: none;">
        <form class="layui-form" id="region_info" action="" lay-filter="regionInfo">
            <input type="hidden" value="" name="_token">
            <input type="hidden" value="" name="id">
            <div class="layui-form-item">
                <label class="layui-form-label">名称</label>
                <div class="layui-input-block">
                    <input type="text" name="region_name" required  lay-verify="required" placeholder="请输入餐台名称" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">餐台桌数</label>
                <div class="layui-input-block">
                    <input type="number" name="region_capacity" required lay-verify="required" placeholder="请输入餐台容量" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">最低消费</label>
                <div class="layui-input-block">
                    <input type="text" name="region_min" required lay-verify="required" placeholder="最低消费" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">排序</label>
                <div class="layui-input-block">
                    <input type="number" name="region_sort" required lay-verify="required" placeholder="排序" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-submit lay-filter="editForm">修改</button>
                </div>
            </div>
        </form>
    </div>
    {{-- 添加餐台区域 --}}
    <div id="addRegion" class="layui-fluid" style="display: none;">
        <form class="layui-form" id="regionAdd" action="" lay-filter="regionAdd">
            <input type="hidden" value="{{ csrf_token() }}" name="_token">
            <div class="layui-form-item">
                <label class="layui-form-label">名称</label>
                <div class="layui-input-block">
                    <input type="text" name="region_name" required  lay-verify="required" placeholder="请输入餐台名称" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">餐台桌数</label>
                <div class="layui-input-block">
                    <input type="number" name="region_capacity" required lay-verify="required" placeholder="请输入餐台容量" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">最低消费</label>
                <div class="layui-input-block">
                    <input type="text" name="region_min" required lay-verify="required" placeholder="最低消费" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">排序</label>
                <div class="layui-input-block">
                    <input type="number" name="region_sort" required lay-verify="required" placeholder="排序" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-submit lay-filter="addForm">添加</button>
                </div>
            </div>
        </form>
    </div>
@endsection
